package cn.szzsi.api.service;

import cn.szzsi.common.model.SiteConfig;
import cn.szzsi.mallservice.ApiInterface;
import com.alibaba.fastjson.JSONObject;

public class ApiService implements ApiInterface {
    @Override
    public JSONObject updateSiteConfig(String shopAlias,String shopId) {
        SiteConfig siteConfig=SiteConfig.dao.findByShopId(shopId);
        if(siteConfig!=null){
            siteConfig.setShopAlias(shopAlias);
            siteConfig.update();
        }else{
            SiteConfig addConfig=new SiteConfig();
            addConfig.set("uid",shopId);
            addConfig.setDepositName("余额");
            addConfig.setShopAlias(shopAlias);
            addConfig.save();
        }
        JSONObject jsonObject=new JSONObject();
        jsonObject.put("code",0);
        jsonObject.put("msg","更新成功!");
        return jsonObject;
    }
}
